//
//  MGTextView.h
//  Express
//
//  Created by lhongl on 2025/9/26.
//  Copyright © 2025 QM. All rights reserved.
//

#import <UIKit/UIKit.h>
@class MGTextView;
/// 提示框位置
typedef NS_ENUM(NSInteger, MGPlaceholderLocation){

    PlaceholderLocationTop, /// 顶部

    PlaceholderLocationMiddle, /// 中间

    PlaceholderLocationBottom, ///底部
};

NS_ASSUME_NONNULL_BEGIN
@protocol MGTextViewDelegate <NSObject>

@optional
/// 输入内容
/// - Parameters:
///   - textView: 输入框
///   - count: 数量
///   - length: 最大字数
- (void)textView:(MGTextView *)textView count:(NSInteger)count limitLength:(NSInteger)length;

/// 内容发生变化
/// - Parameters:
///   - textView: 输入框
///   - text: 内容
- (void)textDidChangeView:(MGTextView *)textView  text:(NSString *)text;

@end

@interface MGTextView : UITextView <UITextViewDelegate>


@property (nonatomic, weak) id <MGTextViewDelegate> customDelegate;
  
// 提示文字
@property (nonatomic, copy) NSString *placeholder;

// 提示框文字大小 【默认14】
@property (nonatomic, strong) UIFont *placeholderFont;

// 提示框文字颜色
@property (nonatomic, strong) UIColor *placeholderColor;

// 提示框文字位置
@property (nonatomic, assign) MGPlaceholderLocation placeholderLocation;

// 文字位置
@property (nonatomic, assign) NSTextAlignment placeholderAlignment;

// 最大字数限制
@property (nonatomic, assign) NSInteger  limitLength;

@end

NS_ASSUME_NONNULL_END
